IF DB_ID('$(STAGING_DATABASE_NAME)') IS NOT NULL
BEGIN
ALTER DATABASE $(STAGING_DATABASE_NAME) SET SINGLE_USER  WITH ROLLBACK IMMEDIATE
END
GO
IF DB_ID('$(STAGING_DATABASE_NAME)') IS NOT NULL
BEGIN
ALTER DATABASE $(STAGING_DATABASE_NAME) SET MULTI_USER WITH ROLLBACK IMMEDIATE
END
GO
IF DB_ID('$(STAGING_DATABASE_NAME)') IS NOT NULL
BEGIN
    DROP DATABASE $(STAGING_DATABASE_NAME)
END
GO